import requests

from Constances import UserAgent

# 搜狗搜索

content = input("请输入搜索内容:")

url = f"https://www.sogou.com/web?query={content}"

dic = {
    "User-Agent": UserAgent
}

# 以下两种请求方式均可
resp = requests.get(url, headers=dic)
# resp = requests.request("get", url, headers=dic)

print(resp)
# 页面源代码
print(resp.text)
resp.close()